<template>
  <BasicModal @register="registerModal" v-bind="$attrs" title="选择窗口部件类型" :footer="null">
    <div class="flex w-full justify-around">
      <Button type="primary" @click="goEditWidgets(widgetsFqn.CHART)">图表部件</Button>
      <Button type="primary" @click="goEditWidgets(widgetsFqn.TABLE)">表格部件</Button>
      <Button type="primary" @click="goEditWidgets(widgetsFqn.CARD)">最新值</Button>
      <Button type="primary" @click="goEditWidgets(widgetsFqn.CONTROL)">控件部件</Button>
      <Button type="primary" @click="goEditWidgets(widgetsFqn.HTML)">静态部件</Button>
    </div>
  </BasicModal>
</template>

<script setup lang="ts">
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { widgetsFqn } from '/@/enums/widgetsEnum';
  import { useGo } from '/@/hooks/web/usePage';
  import { Button } from 'ant-design-vue';

  const go = useGo();
  const [registerModal] = useModalInner();
  const goEditWidgets = (type: string) => {
    go(`/tb-resources/widgets-coding?key=add&type=${type}`);
  };
</script>
